package com.joca.scheduling.selenium;

import com.thoughtworks.selenium.*;
import java.util.regex.Pattern;

public class Selenium extends SeleneseTestCase {
	public void setUp() throws Exception {
		setUp("http://change-this-to-the-site-you-are-testing/", "*chrome");
	}
	public void testNew() throws Exception {
		selenium.open("/schedulingssa/");
		selenium.type("userName", "joca.fabregas");
		selenium.type("password", "scheduling");
		selenium.click("//input[@value='Log in']");
		selenium.waitForPageToLoad("30000");
		selenium.click("link=Registration");
		selenium.waitForPageToLoad("30000");
		selenium.type("name", "Jovan");
		selenium.type("surname", "Dimitrijevic");
		selenium.type("username", "joca");
		selenium.type("password", "joca");
		selenium.select("role", "label=Student");
		selenium.click("//input[@value='Save']");
		selenium.waitForPageToLoad("30000");
		selenium.type("name", "Dragan");
		selenium.type("surname", "Djuric");
		selenium.type("username", "dragan");
		selenium.type("password", "dragan");
		selenium.select("role", "label=Professor");
		selenium.click("//input[@value='Save']");
		selenium.waitForPageToLoad("30000");
		selenium.click("link=LogOut");
		selenium.waitForPageToLoad("30000");
		selenium.type("userName", "joca");
		selenium.type("password", "joca");
		selenium.click("//input[@value='Log in']");
		selenium.waitForPageToLoad("30000");
		selenium.click("//div[@id='content']/div/div[2]/div/table/tbody/tr[2]/td[4]/a");
		selenium.waitForPageToLoad("30000");
		selenium.type("description", "Ispit iz ssa.");
		selenium.click("//input[@value='Save']");
		selenium.waitForPageToLoad("30000");
		selenium.click("link=LogOut");
		selenium.waitForPageToLoad("30000");
		selenium.type("userName", "dragan");
		selenium.type("password", "dragan");
		selenium.click("//input[@value='Log in']");
		selenium.waitForPageToLoad("30000");
		selenium.click("link=Reply");
		selenium.waitForPageToLoad("30000");
		selenium.type("reason", "10 :)");
		selenium.click("submit");
		selenium.waitForPageToLoad("30000");
		selenium.click("link=LogOut");
		selenium.waitForPageToLoad("30000");
	}
}
